import request from '@/utils/request'

//样品检验---申请
export function apply(params, data) {
  return request({
    url: `/sample-inspection/apply/create`,
    method: 'post',
    params: params,
    data: data
  })
}

//获取项目名称
export function projectName() {
  return request({
    url: '/project-start/project/list-ongoing',
    method: 'get'
  })
}

export function projectNamesss() {
  return request({
    url: `/project-start/project/all-data?type=1`,
    method: 'get'
  })
}

//样品检验---我申请的列表
export function applyList(data) {
  return request({
    url: '/sample-inspection/apply/list',
    method: 'post',
    data
  })
}

//样品检验---申请审批
export function applyCheck(data) {
  return request({
    url: '/sample-inspection/apply/check',
    method: 'put',
    data
  })
}

//样品检验---报告结果的审核
export function reportCheck(data) {
  return request({
    url: '/sample-inspection/task/report/check',
    method: 'put',
    data
  })
}

//样品检验---撤销申请
export function undoCheck(data) {
  return request({
    url: '/sample-inspection/apply/undo/check',
    method: 'put',
    data
  })
}

//样品检验---分配
export function allocation(data) {
  return request({
    url: '/sample-inspection/task/allocation',
    method: 'put',
    data
  })
}

//样品检验---留样
export function samples(data) {
  return request({
    url: '/reserve-sample/create',
    method: 'post',
    data
  })
}

//样品检验---提交检查结果报告
export function report(data) {
  return request({
    url: '/sample-inspection/task/report/commit',
    method: 'put',
    data
  })
}

//样品检验---撤销申请
export function undo(id) {
  return request({
    url: `/sample-inspection/apply/undo/commit?id=${id}`,
    method: 'get'

  })
}

//样品检验---操作记录
export function history(data) {
  return request({
    url: '/sample-inspection/apply/history/list',
    method: 'post',
    data
  })
}

export function taskHistory(data) {
  return request({
    url: '/sample-inspection/task/history/list',
    method: 'post',
    data
  })
}

//样品检验---详情
export function detail(id) {
  return request({
    url: `/sample-inspection/apply/detail?id=${id}`,
    method: 'get'
  })
}

export function taskdetail(id) {
  return request({
    url: `/sample-inspection/task/detail?id=${id}`,
    method: 'get'
  })
}

export function myTaskdetail(id) {
  return request({
    url: `/sample-inspection/task/flow-id/detail?id=${id}`,
    method: 'get'
  })
}

//样品检验---详情
export function flowDetail(id) {
  return request({
    url: `/sample-inspection/apply/flow-id/detail?id=${id}`,
    method: 'get'
  })
}

//样品检验---检验任务
export function myWait(data) {
  return request({
    url: '/sample-inspection/task/list',
    method: 'post',
    data
  })
}

//样品检验--质量标准
export function quality(data) {
  return request({
    url: '/quality/standard/list',
    method: 'post',
    data
  })
}

//样品检验--查看质量标准
export function viewQuality(id) {
  return request({
    url: `/quality/standard/detail?id=${id}`,
    method: 'get'
  })
}

//样品检验   检验任务---查看报告
export function viewReport(id) {
  return request({
    url: `/sample-inspection/task/view/report?id=${id}`,
    method: 'get'
  })
}

//---送检申请查看报告
export function applyViewReport(id) {
  return request({
    url: `/sample-inspection/apply/view/report?id=${id}`,
    method: 'get'
  })
}

//分配--------负责人
export function applyHeader(data) {
  return request({
    url: `/check/yi-yao/inspection/header/list`,
    method: 'post',
    data
  })
}

//分配--------参与人
export function applyUser(data) {
  return request({
    url: `/check/yi-yao/inspection/user/list`,
    method: 'post',
    data
  })
}

//检品名称----
export function applyGoodsrSample(data) {
  return request({
    url: `/check/yi-yao/sample/list`,
    method: 'post',
    data
  })
}

//撤销
export function applyUndo(data) {
  return request({
    url: `/check/cancel`,
    method: 'post',
    data
  })
}

//送检申请---编辑
export function applyEditor(data) {
  return request({
    url: `/sample-inspection/apply/back/update`,
    method: 'post',
    data
  })
}

//回退编辑报告
export function applyEditorUpdate(data) {
  return request({
    url: `/sample-inspection/task/back/update`,
    method: 'post',
    data
  })
}

export function lookInfoSet(params) {
  return request({
    url: '/sys/dict/list-by-type',
    method: 'get',
    params
  })
}

export function projectListA() {
  return request({
    url: '/sample-inspection/apply/all/project',
    method: 'get'
  })
}

export function projectListB() {
  return request({
    url: '/sample-inspection/task/all/project',
    method: 'get'
  })
}

//留样包装
export function samplePackaging() {
  return request({
    url: '/stability-base/packing-material/downList?type=2',
    method: 'get'
  })
}

//留样位置
export function sampleLocation(key) {
  return request({
    url: `/stability-base/sample-location/downList?key=${key}`,
    method: 'get'
  })
}

//留样位置创建
export function sampleLocationCreate(data) {
  return request({
    url: '/stability-base/sample-location/create',
    method: 'post',
    data
  })
}

//样品类型
export function sampleType() {
  return request({
    url: `/stability-base/sampleType/downList`,
    method: 'get'
  })
}

//返样
export function sampleReturn(data) {
  return request({
    url: `/sample-inspection/task/return-sample/commit`,
    method: 'post',
    data
  })
}

//返样编辑
export function sampleReturnUpdate(data) {
  return request({
    url: `/sample-inspection/task/return-sample/update`,
    method: 'post',
    data
  })
}

//返样审批
export function sampleReturnCheck(data) {
  return request({
    url: `/sample-inspection/task/return-sample/check`,
    method: 'post',
    data
  })
}

//检验结果删除
export function sampleUpdate(data) {
  return request({
    url: `/sample-inspection/task/inspection-result/update`,
    method: 'post',
    data
  })
}

//检验结果统计详情
export function sampleListTable(data) {
  return request({
    url: `/stability-plan/test/table/detail`,
    method: 'post',
    data
  })
}

//检验结果统计更新
export function sampleListUpdate(data) {
  return request({
    url: `/stability-plan/test/table/update`,
    method: 'post',
    data
  })
}

//查看报告
export function sampleListReport(id) {
  return request({
    url: `/sample-inspection/apply/view/report?id=${id}`,
    method: 'get'
  })
}
